<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>我是一个刷粉匠</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="刷粉有风险，吃瓜需谨慎" />
<style>
	body,div,p,span,img {margin: 0;padding: 0;border: none;outline: none}
	body {width: 100%; height: 100%}
	.wrap {width: 100%; /*heidht: 1136px;*/ margin: 0 auto; text-align: center}
	#count {font-size:96px;color:#222; margin: 20px; 0;text-align: center}
	.on {box-shadow: 0 0 5px rgba(0,0,0,.15)}
	#begin, #stop {cursor: pointer;border: 10px solid #FFF;width: 64px;height: 64px;border-radius: 64px}
	#begin:hover, #stop:hover {box-shadow: 0 0 5px rgba(0,0,0,.15)}
</style>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<div class="wrap">
	<div><img src="/assets/img/chigua.gif" /></div>
	<div style="text-align:center">一大波吃瓜群众正在赶来<br />已经到达现场的吃瓜群众<br />↓↓↓</div>
	<div id="count">0</div>
<div>
<img id="begin" src="/assets/img/play.png" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<img id="stop" class="on" src="/assets/img/stop.png" />
</div>
</div>
<script>
window.status = 0;

$('#begin').bind('click', function() {
	window.status = 1;
	window.count = parseInt($('#count').html());
	if (window.status == 1) {
		window.client = setInterval(function() {
			$.get('/url/view', {}, function(data) {
				//console.log(data);
				if (data.indexOf('HTTP/1.1 200 OK') > -1) {
					window.count ++;
					$('#count').html(window.count);
				}
				
			});
			
		}, 2000);
	}
	$(this).addClass('on').siblings('img').removeClass('on');
});
$('#stop').bind('click', function() {
	window.status = 0;
	$(this).addClass('on').siblings('img').removeClass('on');
	clearInterval(window.client);
});

	
</script>
</body>
</html>